﻿#pragma once


// GlobalVariables

class GlobalVariables : public CWnd
{
	DECLARE_DYNAMIC(GlobalVariables)

public:
	GlobalVariables();
	virtual ~GlobalVariables();

protected:
	DECLARE_MESSAGE_MAP()
};

struct AddressPLC
{
	int TotalCount;  //单卷切片总数
	int	NGCount;     //瑕疵数量
	int	OKCount;     //切片OK数
	//int	MaterialNum;  //负极料卷信息
	int	FilmWidth;    //极片宽度
	int	CreateTime;   //极卷上卷时间
	int	CutterNum;    //刀模编号
	
	int	Tension;     //放卷张力
	int Box1;      //负极弹夹信息
	int Box2;    //料盒2
	int RollChange; //换卷标志
	int ClipChange;//换弹夹标志
	int Alarm;//报警地址
	int EndTime;  //极卷下料时间
	int FoilHight; //极耳高度
	int FoilWidth;  //极耳宽度
	int FoilDistance;   //极耳边距
	int FilmHight;    //极片长度
	int CoatWidht;    //极片宽度
	int CoatHight;    //边涂高度
	int CCDFlag;      //CCD标志位
	int ProdunctNum;   //产品条码
	int WorkerNum;     //员工工号

	int StopReason;
	int AlarmCode;
	int EquStatus;           //设备状态
	int SetCutSpeed;        //切刀设置速度
	int RealCutSpeed;         //实际速度
	int SetTension;           //放卷张力设置
	int RealTension;          //实际张力
	int	CutterFrequency;   //切刀寿命
	int FoilLife;           //极耳模具寿命
	int AngleLife;          //角模具寿命
	int FoilLife1;           //极耳模具寿命
	int AngleLife1;          //角模具寿命
	int PenYouliang;        //喷油量
	int ProductNum;         //极片数量
	int PictureFlame;       //图片帧号  int
	int Result;             //图像结果 int
	int SizeAdd;            //9个尺寸数据连续float
	int MaterialNum;        //极卷号
	int npeiFang;           //配方
	int nErrorTypeAddress;  //废品量  
	int nTotalErrorPerBatchAddress;   //ng细分28个
	int nResultAddress;     //总产量 
};
struct SendMes
{
	float nNGCount;    //瑕疵数量
	float	dOKCount;     //切片OK数
	
	float	dFilmWidth;    //极片宽度
	CString	cstrCreateTime;   //创建时间
	CString	cstrCutterNum;    //刀模编号
	int	dCutterFrequency;   //切刀次数
	float	dTension;     //放卷张力
	CString cstrBox1;      //负极弹夹信息	
	CString	cstrEndTime;   //下料时间
	float fFoilHight; //极耳高度
	float fFoilWidth;  //极耳宽度
	float fFoilDistance;   //极耳边距
	float fFilmHight;    //极片长度
	float fCoatWidht;    //极片宽度
	float fCoatHight;    //边涂高度
	float fCCDFlag;      //CCD标志位

	int nStopReason;
	int nAlarmCode;            //报警代码
	int nEquStatus;           //设备状态
	int nSetCutSpeed;        //切刀设置速度
	int nRealCutSpeed;         //实际速度
	int nSetTension;           //放卷张力设置
	int nRealTension;          //实际张力
	int	nCutterFrequency;   //切刀寿命
	int nFoilLife;           //极耳模具寿命
	int nAngleLife;          //角模具寿命
	int nFoilLife1;           //极耳模具寿命
	int nAngleLife1;          //角模具寿命
	int nPenYouliang;        //喷油量
	int nProductNum;         //极片数量
	int nPictureFlame;       //图片帧号  int
	int nResult;             //图像结果 int
	std::vector<double> SizeAdd;  //9个尺寸数据连续float   
	CString	cstrMaterialNum;  //负极料卷信息
	CString cstrnpeiFang;           //配方
	int nErrorTypeAddress;  //废品量  
	std::vector<int> nTotalErrorPerBatchAddress;//ng细分28个	 
	int nResultAddress;     //总产量 
};
struct InfoMES
{
	CString IP;
	int Port;
	int OutTime;          //超时时间
	CString FactoryCode;  //工厂编号
	CString EquipmentCode;  //设备编号
	CString UserName;  //FTP张号
	CString UserPassWord;  //FTP密码
	CString ImaagePath;
	CString SizePath;
	CString FTPPath;
	CString TestCode;  //试验单号
	CString ProductIden; //极卷号
	CString DanJiaCode; //弹夹信息
	int ProductType;  //产品类型
	CString WorkSN;    //工序编号
	CString WorkerSN;   //员工编号
	CString cstrProductType;
	CString cstrProductNUM;   //产品条码
};

struct Land
{
	CString Use1;
	CString PassWord1;
	CString Use2;
	CString PassWord2;
	CString Use3;
	CString PassWord3;
	int PassLevel;
};
extern CString g_FilePathPLC;
extern CString g_FilePathLog;
extern CString g_SystemPathPLC;
extern CString g_MESPathLog;
extern AddressPLC g_PLCAddress;
extern DHInterface* g_pPlc;//Plc通信模块
extern DHInterface* g_pMES;//Plc通信模块
extern InfoMES g_InfoMes;  //MES信息
extern Land g_Land; //账号密码信息
extern int MESStatus; //账MES状态
extern SendMes g_SendMes;  //发送数据
extern PVOID     g_pMainDialog;       //主对话框;
extern int SendType; //发送类型
extern int PassType; //MES登录
extern int g_ProductCod; //产品条码自动读取
extern int g_DanJiaCode; //弹夹条码自动读取
extern int g_nSendMes; //是否上传MES
extern int g_nAutoReadWorker; //是否自动员工号
extern DHInterface* g_pWatch;//异常模块